package com.rjxy.plansystemmanagement.mapper;

import com.rjxy.plansystemmanagement.entity.ChargebacksInformation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ChargebacksMapper {
    /**
     * 查询所有退单信息
     * @return
     */
    @Select("select * from ChargebacksInformation")
    List<ChargebacksInformation> list();

    /**
     * 根据id删除指定订单信息
     * @param id
     */
    @Delete("delete from ChargebacksInformation where id = #{id};")
    void deleteChargeback(Integer id);


    @Insert("insert into ChargebacksInformation(ChargeOrderNo,ChargeOrderTime,Price,SpaceType,FlightID,UserID,BuyNum,TPrice)" +
            "VALUES (#{ChargeOrderNo},#{ChargeOrderTime},#{Price},#{SpaceType},#{FlightID},#{UserID},#{BuyNum},#{TPrice})")
    void addChargeback(ChargebacksInformation chargebacksInformation);

    @Select("select * from ChargebacksInformation where id = #{id}")
    ChargebacksInformation getChargebackById(Integer id);
}
